package com.yuyu.qingmangmall.product.vo;

import com.yuyu.qingmangmall.product.entity.SkuImagesEntity;
import com.yuyu.qingmangmall.product.entity.SkuInfoEntity;
import com.yuyu.qingmangmall.product.entity.SpuInfoDescEntity;
import lombok.Data;
import lombok.ToString;

import java.util.List;

@Data
public class SkuItemVo {
    // 1.sku基本属性  pms_sku_info
    SkuInfoEntity skuInfoEntity;

    // 2.sku的图片信息 pms_sku_images
    List<SkuImagesEntity> images;

    // 商品库存
    Boolean hasStock = true;

    // 3.获取spu的销售属性组合
    List<SkuItemSaleAttrVo> saleAttrs;

    // 4.获取spu的介绍
    SpuInfoDescEntity desp;

    // 5.获取spu的规格参数的信息
    List<SkuItemAttrGroupVo> groupAttrs;

    @ToString
    @Data
    public static class SkuItemSaleAttrVo{
        private Long attrId;
        private String attrName;
        private List<AttrValueWithSkuIds> attrValues;
    }

    @ToString
    @Data
    public static class SkuItemAttrGroupVo{
        private String groupName;
        private List<SpuBaseAttrVo> attrs;
    }

    @ToString
    @Data
    public static class SpuBaseAttrVo{
        private String attrName;
        private String attrValue;
    }
}
